<!DOCTYPE html>
<title>Test that setting currentTime changes the time, and setting invalid values throw exceptions.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<video></video>
<script>
async_test(function(t) {
    var video = document.querySelector("video");

    video.oncanplaythrough = t.step_func_done(function () {
        assert_throws_js(TypeError, function() { video.currentTime = -Infinity; });
        assert_throws_js(TypeError, function() { video.currentTime = Infinity; });
        assert_throws_js(TypeError, function() { video.currentTime = NaN; });
        video.currentTime = 1.5;
        assert_equals(video.currentTime, 1.5);
        video.play();
        video.currentTime = 3.1;
        assert_equals(video.currentTime, 3.1);
    });

    video.src = "content/test.ogv";
});
</script>